package com.leyantech.ecp.agenx.task.filter.task;

import com.leyantech.ecp.agenx.task.filter.RateLimiter;

import com.google.inject.Singleton;
import io.vertx.core.json.JsonObject;

/**
 * @author eahau, {@literal <eahau@foxmail.com>}
 * @date 2022-11-15.
 */
@Singleton
public class TaskMessageRateLimiter extends RateLimiter<JsonObject> {

  @Override
  protected String[] getRaterKeys(JsonObject jsonObject) {
    final String sid = jsonObject.getString("sid");
    final String aid = jsonObject.getString("aid");
    return new String[]{sid, aid};
  }

}
